<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends  CI_Controller {
	
	function __construct()
	{
		parent::__construct();
		$this->load->helper('url');
	}
	
	function myhome(){
		$name="xiong";
		$datearray=array('v_name'=>$name);
		$this->load->view("test/index",$datearray);
		
	}
	
	function index(){
		$this->load->view("test/register");
	}
	
	function register(){
		
		$username= $this->input->post('username');
		$password=$this->input->post('password');
		$user_array=array('username'=>$username,'password'=>$password);
		$this->load->model('home_m');
		$data=array('username'=>$username,'password'=>$password);
		$this->home_m->insert($data);
		$this->load->view("test/success",$user_array);
	}
	
	function get(){
		$username=$this->input->get('username');
		$this->load->model('home_m');
		echo $username;
		$restr=$this->home_m->get($username);
		
		foreach ($restr as $row){
			echo $row->id;
			echo $row->username;
			echo $row->password;
		}
	}
	function login(){
		
	}
}

?>